home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / cg / rmword.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-28  |  2KB  |  82 lines

  1. /* RmWord -- Delete a word from the Dictionary File */
  2. /* By Bob Caron ©1995 NewTek, Inc.                  */
  3.  
  4. call addlib(CG_AREXX,0)
  5.  
  6. call pragma(d,"rexx:CG/SpellCheck_Support")
  7.  
  8. call req_bar("Erase word in dictionary")
  9.  
  10. if exists(words)=0 then do
  11.    call req_tell("Error! wordfile is missing.")
  12.    if exists(words.bu) then
  13.       if req_ask("Use backup word file?") then
  14.          address command "copy words.bu words"
  15.                 else do
  16.       call req_tell("You need to replace:","'rexx:cg/spellcheck_support/words'")
  17.       call req_bar("ToasterCG")
  18.       call remlib(CG_AREXX)
  19.       exit
  20.       end
  21.  
  22.    if exists(words)=0 then do
  23.       call req_tell("Backup file is also missing!","Replace 'rexx:cg/spellcheck_support/words'")
  24.       __QUIT
  25.       call req_bar("ToasterCG")
  26.       call remlib(CG_AREXX)
  27.       exit
  28.       end
  29.    end
  30.  
  31.  
  32. word=req_string("Word To Delete:")
  33.  
  34. if word="" then do
  35.    call REQ_TELL("Canceled!")
  36.    call req_bar("ToasterCG")
  37.    call remlib(CG_AREXX)
  38.    exit
  39.    end
  40.  
  41. if req_ask("Delete "word" from","Dictionary File?")=0 then do
  42.    call REQ_TELL("Canceled!")
  43.    call req_bar("ToasterCG")
  44.    call remlib(CG_AREXX)
  45.    exit
  46.    end
  47.  
  48. success=rmword(word)
  49. if success then
  50.    call req_tell("'"word"'"||" removed.")
  51. call req_bar("ToasterCG")
  52. call remlib(CG_AREXX)
  53.  
  54. exit
  55.  
  56. rmword:
  57.  parse arg word
  58.  call req_bar("Removing Word")
  59.  call pragma(d,"rexx:CG/SpellCheck_Support")
  60.  if exists('rexx:cg/spellcheck_support/rmword')=0 then do
  61.     req_tell("RmWord Program Missing!","It needs to be in 'Rexx/cg/Spellcheck_support'")
  62.     call req_bar("ToasterCG")
  63.     return 0
  64.     end
  65.  address command "delete words.bu2"
  66.  address command "rename Toaster:Arexx/cg/spellcheck_support/words.bu Toaster:Arexx/cg/spellcheck_support/words.bu2"
  67.  address command "rename Toaster:Arexx/cg/spellcheck_support/words Toaster:Arexx/cg/spellcheck_support/words.bu"
  68.  address command "rmword Toaster:Arexx/cg/spellcheck_support/words.bu Toaster:Arexx/cg/spellcheck_support/new_words "||word
  69.  if exists("Toaster:Arexx/cg/spellcheck_support/new_words") then do
  70.     address command "rename Toaster:Arexx/cg/spellcheck_support/new_words Toaster:Arexx/cg/spellcheck_support/words"
  71.     address command "delete Toaster:Arexx/cg/spellcheck_support/word_temp"
  72.     address command "delete Toaster:Arexx/cg/spellcheck_support/word_temp.srt"
  73. return 1
  74.     end
  75.  
  76.  else
  77.     call req_tell("Error! Creating new Wordfile")
  78. return 0
  79.  
  80.  
  81. /* $VER:Rmword V1.5 2-14-95 <Cheatah's Never Prosper!>
  82. */